<?php
/**
 * Create by 11li
 * Date 2020/1/7
 * Time 11:43
 *
 */

namespace app\common\service;


use app\common\model\Banner;

class BannerService extends BaseService
{
	
	/**
	 * 根据位置获取轮播广告
	 * @param $positions
	 * @return array|false|\PDOStatement|string|\think\Collection
	 * @throws \think\db\exception\DataNotFoundException
	 * @throws \think\db\exception\ModelNotFoundException
	 * @throws \think\exception\DbException
	 */
	public function getBannerByPositions($positions) {
		if(empty($positions) || !is_array($positions)) {
			return [];
		}
		
		$model = new Banner();
		$list = $model->getBannerByPositions($positions);
		
		
		return $list;
	}
}